<?php
/**
 * DouPHP小程序模块
 * Author: cuihaifeng  qq 366131726 微信同号
 * 网址：www.zbxingke.com www.0533hf.com
 */
if (!defined('IN_DOUCO_API')) {
    die('Access Denied');
}

/**
 * 获取用户的收藏
 */
function doPageGet(){
    global $_GPC,$_W,$dou;

    $page_id = $_GPC['id'];
    $page = pdo_get('page',array('id'=>$page_id));
    if(!$page){
        return wxapp_result(404,'页面不存在');
    }
    $top_id = $page['parent_id'] == 0 ? $page_id : $page['parent_id'];
    $page_list = $dou->get_page_list($top_id, $page_id);

    $page_first = pdo_get('page',array('id'=>$top_id));
    array_unshift($page_list,$page_first);
    $page['page_list'] = $page_list;
    return wxapp_result(0,'success',$page);
}


